package edu.hrbu.spring.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author 徐登宇
 */
public class UserBeanPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("生命周期第三步：Bean后置处理器的before方法执行，即将进行初始化");
        return BeanPostProcessor.super.postProcessBeforeInitialization(bean, beanName);
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("生命周期第五步：Bean后置处理器的after方法执行，初始化结束完毕");
        return BeanPostProcessor.super.postProcessAfterInitialization(bean, beanName);
    }
}
